﻿using System.Text;

namespace uTILLIty.ADExtractor.Core.Exporters.Csv
{
	public class CsvExporterConfiguration
	{
		public CsvExporterConfiguration()
		{
			Separator = ";";
			ValueEnquotation = ValueEnquotationType.None;
		}

		private string _separator;
		public string Separator
		{
			get { return string.IsNullOrWhiteSpace(_separator) ? ";" : _separator; }
			set { _separator = value; }
		}

		public string OutputFilename { get; set; }
		public string Encoding { get; set; }
		public Encoding EncodingParsed
		{
			get
			{
				if (string.IsNullOrWhiteSpace(Encoding))
					return System.Text.Encoding.Default;
				return System.Text.Encoding.GetEncoding(Encoding);
			}
		}

		public ValueEnquotationType ValueEnquotation { get; set; }
	}
}